<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace common\components\wechat\models;

/**
 * 提交JSAPI输入对象
 *
 * @author emhome
 */
class JsApiPay extends BaseModel {

    /**
     * 设置微信分配的公众账号ID
     * @param string $value 
     * */
    public $appId;

    /**
     * 设置支付时间戳
     * @param string $value 
     * */
    public $timeStamp;

    /**
     * 随机字符串
     * @param string $value 
     * */
    public $nonceStr;

    /**
     * 设置订单详情扩展字符串
     * @param string $value 
     * */
    public $package;

    /**
     * 设置签名方式
     * @param string $value 
     * */
    public $signType;

    /**
     * 设置签名方式
     * @param string $value 
     * */
    public $paySign;

    /**
     * 交易中心统一下单请求参数校验
     * @inheritdoc
     */
    public function rules() {
        return [
            [['appId', 'timeStamp', 'nonceStr', 'package'], 'required'],
            [['appId', 'nonceStr', 'paySign', 'signType'], 'string', 'max' => 32],
            //校验APPID
            ['signType', 'in', 'range' => ['MD5', 'HMAC-SHA256', 'MD5']],
        ];
    }

}
